package com.ezbuy.common.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * ezbuy 2018/12/1 下午5:40
 */
public class ServiceType {
    public ProtoFile file;
    public String name;
    public List<MethodType> methods = new ArrayList<>();
    public List<String> imports = new ArrayList<>();

    public ProtoFile getFile() {
        return file;
    }

    public void setFile(ProtoFile file) {
        this.file = file;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<MethodType> getMethods() {
        return methods;
    }

    public void setMethods(List<MethodType> methods) {
        this.methods = methods;
    }

    public void addMethod(MethodType methodType) {
        this.methods.add(methodType);
    }

    public List<String> getImports() {
        return imports;
    }

    public void setImports(List<String> imports) {
        this.imports = imports;
    }

    public void addImport(String imp) {
        if (imports.contains(imp)) {
            return;
        }
        this.imports.add(imp);
    }

    @Override
    public String toString() {
        return "ServiceType{" +
                "name='" + name + '\'' +
                ", methods=" + methods +
                ", imports=" + imports +
                '}';
    }
}
